/*
 * XML Type:  XRole
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XRole
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XRole(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XRoleImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.widget.XRole
{
    private static final long serialVersionUID = 1L;
    
    public XRoleImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName CHILDREN$0 = 
        new javax.xml.namespace.QName("", "children");
    
    
    /**
     * Gets the "children" element
     */
    public com.seedwill.xul.widget.XRole getChildren()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XRole target = null;
            target = (com.seedwill.xul.widget.XRole)get_store().find_element_user(CHILDREN$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "children" element
     */
    public void setChildren(com.seedwill.xul.widget.XRole children)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XRole target = null;
            target = (com.seedwill.xul.widget.XRole)get_store().find_element_user(CHILDREN$0, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XRole)get_store().add_element_user(CHILDREN$0);
            }
            target.set(children);
        }
    }
    
    /**
     * Appends and returns a new empty "children" element
     */
    public com.seedwill.xul.widget.XRole addNewChildren()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XRole target = null;
            target = (com.seedwill.xul.widget.XRole)get_store().add_element_user(CHILDREN$0);
            return target;
        }
    }
}
